%% formatFigure.m
% 
% Format figures and predefine figure properties
%
%% Description
%
% This script modifies the default properties of figures. The script also predefines properties for line plots, scatter plots, and axes. These properties are contained in cell arrays. The script is used to maintain consistent formatting across all figures.
%
%% Examples
%
%   plot(x, y, blackLine{:})
%   plot(x, y, grayLine{:})
%   set(gca, gammaAxis{:})
%

%% Predefine color palette

black = '#000000';
gray = '#c0c0c0';

%% Predefine line thickness

thick = 3;
thin = thick ./ 3;

%% Set default properties for figures

figureWidth = 8.5;
figureHeight = 6.375;
set(groot, ...
	'defaultFigureUnits', 'inches', ...
	'defaultFigurePosition', [1, 1, figureWidth, figureHeight], ...
	'defaultFigurePaperPosition', [0, 0, figureWidth, figureHeight], ...
	'defaultFigurePaperSize', [figureWidth, figureHeight], ...
	'defaultAxesFontName', 'Helvetica', ...
	'defaultAxesFontSize', 22, ...
	'defaultAxesLabelFontSizeMultiplier', 1, ...
	'defaultAxesTitleFontSizeMultiplier', 1, ...
	'defaultAxesTitleFontWeight', 'normal', ...
	'defaultAxesXColor', 'k', ...
	'defaultAxesYColor', 'k', ...
	'defaultAxesGridColor', 'k', ...
	'defaultAxesLineWidth', thin, ...
	'defaultAxesYGrid', 'on', ...
	'defaultAxesXGrid', 'on', ...
	'defaultAxesTickDirMode',  'manual', ...
	'defaultAxesTickLength', [0, 0], ...
	'defaultAxesBox', 'off' ...
)

%% Predefine line properties

% Define solid thick black line
blackLine = {
	'Color', black, ...
	'LineWidth', thick
};

% Define solid thin gray line
grayLine = {
	'Color', gray, ...
	'LineWidth', thin
};

% Define dashed black line with dots
dashedLine = {
	'Color', black, ...
	'LineWidth', thin, ...
	'LineStyle', '--', ...
	'MarkerFaceColor', black, ...
	'MarkerEdgeColor', black, ...
	'Marker', 'o', ...
	'MarkerSize', 11
};

% Define black dot
blackDot = {
	'LineStyle', 'none', ...
	'MarkerFaceColor', black, ...
	'MarkerEdgeColor', black, ...
	'Marker', 'o', ...
	'MarkerSize', 11
};

%% Predefine axis properties

% Define x-axis with completion probability
gammaAxis = {
	'XLim', [0, 1], ...
	'XTick', 0 : 0.2 : 1, ...
	'XTickLabel', ["0%", "20%", "40%", "60%", "80%", "100%"]
};

% Define x-axis with corrective steps
stepAxis = {
	'XLim', [1, 4], ...
	'XTick', 1 : 1 : 4
};